<?php
	header('content-type:text/html;charset=utf-8'); 
	//重要!兩種情況中都要判斷DID是否存在,DID不存在,還要判斷工單號和機台號是否為空
	//2018-3-16 11:08:32注釋:想起來好像前端就應該做判斷過濾掉這種情況
	//$GX=$_GET["nos"];
	$id = $_POST["id"];//当前机台
	$number = $_POST["number"];//操作人员
	$finishnumber=$_POST["finishnumber"];
	
	$pdo =new pdo("mysql:host=127.0.0.1;port=3306;dbname=tddb;","root","tdled2018");
	$pdo->query("set character set 'utf8'");//读库 
	$pdo->query("set names 'utf8'");//写库 
	
	$sql = "UPDATE `bpirecord` SET `number`='".$number."',`finishnumber`='".$finishnumber."'
	
	WHERE 
		`id` = '".$id."' 
		";
	
	$res=$pdo->exec($sql);//执行插入 
	//$res->execute(); //执行一条查询语句
	
	//$rows=mysql_fetch_row($result);
	//echo $rows[0];
	//Fetch into associative array
	//while ( $row = $res->fetch())  {
		//echo json_encode($row)."</br>";
		//$dbdata[]=$row;
	//}
	
	//Print array in JSON format
	echo "保存成功".$sql;
	
	
?>